/**
 * 
 */

package com.shy.portal.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.shy.base.service.impl.BaseServiceImpl;
import com.shy.portal.dao.MenuDao;
import com.shy.portal.entity.Menu;
import com.shy.portal.service.MenuService;

/**
 * <p>
 * Title: MenuServiceImpl
 * </p>
 * <p>
 * Description:菜单管理service层实现
 * </p>
 * <p>
 * Company:ipebg
 * </p>
 * 
 * @author H2013788
 */
@Transactional
@Service("menuService")
public class MenuServiceImpl extends BaseServiceImpl<Menu> implements MenuService {

    /**
     * dao层
     */
    @Resource
    private MenuDao menuDao;

    /**
     * dao层
     * @param menuDao 菜单dao
     * @author H2201965
     * @date 2018/2/6下午3:41:30
     */
    @Resource
    private void setBaseDao(MenuDao menuDao) {
        this.baseDao = menuDao;
    }

    @Override
    public int getMaxLevel() {
        return menuDao.getMaxLevel();
    }

    @Override
    public int getMaxSortByParent(Integer pid) {
        return menuDao.getMaxSortByParent(pid);
    }

    @Override
    public List<Menu> findAllListOrderByCode() {
        return menuDao.findAllListOrderByCode();
    }

    @Override
    public List<Menu> getMenusByRoleId(Integer roleId) {
        return menuDao.getMenusByRoleId(roleId);
    }

}
